<template>
  <n-modal v-model:show="showModal" preset="card" style="width: 800px; max-width: 90vw">
    <div class="model-container">
      <div class="model-content">
        <div class="model-title-box">
          <div class="icon-title-legend"></div>
          <div class="title-text">新建巡检作业</div>
          <div class="close-box" @click="showModal = false"></div>
        </div>
      </div>
    </div>
  </n-modal>
</template>

<script setup lang="ts">
  import { ref } from 'vue';

  // 定义响应式数据
  const showModal = ref(false);

  // 显示模态框的方法
  function show() {
    showModal.value = true;
  }

  // 暴露方法给父组件
  defineExpose({
    show,
  });
</script>

<style scoped>
  .model-container {
    width: 100%;
  }

  .model-content {
    width: 100%;
  }

  .model-title-box {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 2.5rem;
    border-bottom: 1px solid #e5e7eb;
    margin-bottom: 1rem;
  }

  .icon-title-legend {
    width: 0.25rem;
    height: 1.25rem;
    background: #3b82f6;
    border-radius: 1px;
  }

  .title-text {
    font-size: 1.125rem;
    font-weight: 500;
    color: #1f2937;
    flex: 1;
    margin-left: 0.5rem;
  }

  .close-box {
    width: 1.5rem;
    height: 1.5rem;
    cursor: pointer;
  }
</style>